/********************************************************************************
* @author: Liu  HZ
* @date: 2024/5/25
* @description: 
********************************************************************************/

#include <iostream>
#include <vector>
#include <algorithm>
#include <boost/algorithm/cxx11/all_of.hpp>
#include <boost/algorithm/cxx11/none_of.hpp>
#include <boost/algorithm/cxx11/any_of.hpp>

int main() {
    std::vector<int> numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

    // 打印原数组
    std::cout << "Original array: ";
    for (int num : numbers) {
        std::cout << num << " ";
    }
    std::cout << std::endl;

    // 使用 std::sort 对数组进行排序
    std::sort(numbers.begin(), numbers.end(), std::greater<int>());

    // 打印排序后的数组
    std::cout << "Sorted array in descending order: ";
    for (int num : numbers) {
        std::cout << num << " ";
    }
    std::cout << std::endl;

    // 使用 Boost 算法进行一些操作
    bool all_positive = boost::algorithm::all_of(numbers, [](int i){ return i > 0; });
    bool any_negative = boost::algorithm::any_of(numbers, [](int i){ return i < 0; });
    bool none_above_ten = boost::algorithm::none_of(numbers, [](int i){ return i > 10; });

    // 打印结果
    std::cout << "All numbers are positive: " << std::boolalpha << all_positive << std::endl;
    std::cout << "Any negative numbers: " << std::boolalpha << any_negative << std::endl;
    std::cout << "No numbers above ten: " << std::boolalpha << none_above_ten << std::endl;

    return 0;
}
